/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package visualcbir.board;

import Grid.Cell.CellItemInterface;

/**
 *
 * @author robertopinho
 */
public class BoardPos {

    public int i = -1;
    public int j = -1;
    int err = Integer.MAX_VALUE;

    BoardPos(CellItemInterface neighbor) {
        this(neighbor.getRow(),neighbor.getCol());
    }

    BoardPos(int i, int j, int err) {
        this.i = i;
        this.j = j;
        this.err = err;
    }
    
    public BoardPos(int i, int j) {
        this.i = i;
        this.j = j;
        this.err = 0;
    }


    @Override
    public int hashCode() {
        int hash = 5;
        hash = 59 * hash + this.i;
        hash = 59 * hash + this.j;
        return hash;
    }

    @Override
    public boolean equals(Object o) {
        BoardPos p = (BoardPos) o;
        return (p.i == this.i && p.j == this.j);
    }
    }
